<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Title</title>
  </head>
  
  <body>
    <input type="button" value="发送请求Get" onclick="sendJQueryGet()">
    <input type="button" value="发送请求Post" onclick="sendJQueryPost()">
    <input type="button" value="发送请求Ajax" onclick="sendJQueryAjax()">
  </body>
  
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script>
  <script>
    function sendJQueryGet() {
      $.get(
        'http://localhost:9000/back_end_get/params?query_name=query',
        (res) => {
          console.log(res); // {code: 200, msg: '请求成功', data: {params: {…}, query: {…}}}
        }
      );
    }
    
    function sendJQueryPost() {
      $.post({
        url: 'http://localhost:9000/back_end_post/params',
        data: JSON.stringify({body_name: 'body'}),
        headers: {
          'Content-Type': 'application/json',
        },
        success: (res) => {
          console.log(res); // {code: 200, msg: '请求成功', data: {params: {…}, body: {…}}}
        },
      });
    }
    
    function sendJQueryAjax() {
      $.ajax({
        url: 'http://localhost:9000/back_end_post/params',
        type: 'POST',
        data: JSON.stringify({body_name: 'body'}),
        headers: {
          'Content-Type': 'application/json',
        },
        success: (res) => {
          console.log(res); // {code: 200, msg: '请求成功', data: {params: {…}, body: {…}}}
        },
      });
    }
  </script>
</html>